import request from '@/utils/request'

const api = {
  serviceCreate: '/t1/service/create', // 新增服务分类
  serviceList: '/t1/service/list', // 服务分类列表
  serviceEdit: '/t1/service/edit', // 编辑服务分类
  serviceDel: '/t1/service/del', // 删除服务分类
  serviceChangeStatus: '/t1/service/change_status', // 禁用|启用服务分类
  serviceContentCreate: '/t1/service_content/create', // 新增服务内容
  serviceContentList: '/t1/service_content/list', // 服务内容列表
  serviceContentEdit: '/t1/service_content/edit', // 编辑服务内容
  serviceContentDel: '/t1/service_content/del', // 删除服务内容
  serviceContentChangeStatus: '/t1/service_content/change_status', // 禁用|启用服务内容
  volunteerLists: '/t1/volunteer/lists', // 志愿者列表
  volunteerCreate: '/t1/volunteer/create', // 添加志愿者
  volunteerInfo: '/t1/volunteer/info', // 志愿者详情
  volunteerEdit: '/t1/volunteer/edit', // 编辑志愿者
  volunteerDel: '/t1/volunteer/del', // 移除志愿者
  checkMobile: '/t1/common/check_mobile', // 根据手机号获取用户详情
  villageList: '/t1/common/village_list', // 村列表
  pointLists: '/t1/point/lists', // 积分明细
  pointReject: '/t1/point/reject', // 积分变动驳回
  createRoles: '/t1/system/create_roles', // 创建角色
  rolesList: '/t1/system/roles_list', // 角色列表
  createPermission: '/t1/system/create_permission', // 新增权限
  permissionList: '/t1/system/permission_list', // 权限列表
  rolePermissionList: '/t1/system/role_permission_list', // 查根据角色id查询权限列表
  givePermission2Role: '/t1/system/give_permission_to_role', // 查根据角色id查询权限列表
  editRoles: '/t1/system/edit_roles', // 修改角色名称
  delRoles: '/t1/system/del_roles', // 删除角色名称
  adminList: '/t1/user/admin_list', // 管理员列表
  giveRole2User: '/t1/system/give_role_to_user', // 给用户分配角色
  addTownAdmin: '/t1/user/add_town_admin', // 添加管理员
  delTownAdmin: '/t1/user/del_town_admin', // 删除管理员
  minePermission: '/t1/system/mine_permission' // 获取我的权限
}

export function serviceCreate (parameter) {
  return request({
    url: api.serviceCreate,
    method: 'post',
    data: parameter
  })
}

export function serviceEdit (parameter) {
  return request({
    url: api.serviceEdit,
    method: 'post',
    data: parameter
  })
}

export function serviceDel (parameter) {
  return request({
    url: api.serviceDel,
    method: 'post',
    data: parameter
  })
}

export function serviceChangeStatus (parameter) {
  return request({
    url: api.serviceChangeStatus,
    method: 'post',
    data: parameter
  })
}

export function serviceList (parameter) {
  return request({
    url: api.serviceList,
    method: 'get',
    params: parameter
  })
}

export function serviceContentCreate (parameter) {
  return request({
    url: api.serviceContentCreate,
    method: 'post',
    data: parameter
  })
}

export function serviceContentEdit (parameter) {
  return request({
    url: api.serviceContentEdit,
    method: 'post',
    data: parameter
  })
}

export function serviceContentDel (parameter) {
  return request({
    url: api.serviceContentDel,
    method: 'post',
    data: parameter
  })
}

export function serviceContentChangeStatus (parameter) {
  return request({
    url: api.serviceContentChangeStatus,
    method: 'post',
    data: parameter
  })
}

export function serviceContentList (parameter) {
  return request({
    url: api.serviceContentList,
    method: 'get',
    params: parameter
  })
}

export function volunteerLists (parameter) {
  return request({
    url: api.volunteerLists,
    method: 'get',
    params: parameter
  })
}

export function volunteerInfo (parameter) {
  return request({
    url: api.volunteerInfo,
    method: 'get',
    params: parameter
  })
}

export function volunteerCreate (parameter) {
  return request({
    url: api.volunteerCreate,
    method: 'post',
    data: parameter
  })
}
export function volunteerEdit (parameter) {
  return request({
    url: api.volunteerEdit,
    method: 'post',
    data: parameter
  })
}

export function volunteerDel (parameter) {
  return request({
    url: api.volunteerDel,
    method: 'post',
    data: parameter
  })
}

export function checkMobile (parameter) {
  return request({
    url: api.checkMobile,
    method: 'get',
    params: parameter
  })
}

export function villageList (parameter) {
  return request({
    url: api.villageList,
    method: 'get',
    params: parameter
  })
}

export function pointLists (parameter) {
  return request({
    url: api.pointLists,
    method: 'get',
    params: parameter
  })
}

export function rolesList (parameter) {
  return request({
    url: api.rolesList,
    method: 'get',
    params: parameter
  })
}

export function createRoles (parameter) {
  return request({
    url: api.createRoles,
    method: 'post',
    data: parameter
  })
}

export function permissionList (parameter) {
  return request({
    url: api.permissionList,
    method: 'get',
    params: parameter
  })
}

export function createPermission (parameter) {
  return request({
    url: api.createPermission,
    method: 'post',
    data: parameter
  })
}

export function rolePermissionList (parameter) {
  return request({
    url: api.rolePermissionList,
    method: 'get',
    params: parameter
  })
}

export function adminList (parameter) {
  return request({
    url: api.adminList,
    method: 'get',
    params: parameter
  })
}

export function minePermission (parameter) {
  return request({
    url: api.minePermission,
    method: 'get',
    params: parameter
  })
}

export function givePermission2Role (parameter) {
  return request({
    url: api.givePermission2Role,
    method: 'post',
    params: parameter
  })
}

export function giveRole2User (parameter) {
  return request({
    url: api.giveRole2User,
    method: 'post',
    params: parameter
  })
}

export function editRoles (parameter) {
  return request({
    url: api.editRoles,
    method: 'post',
    params: parameter
  })
}

export function delRoles (parameter) {
  return request({
    url: api.delRoles,
    method: 'post',
    params: parameter
  })
}

export function addTownAdmin (parameter) {
  return request({
    url: api.addTownAdmin,
    method: 'post',
    params: parameter
  })
}

export function delTownAdmin (parameter) {
  return request({
    url: api.delTownAdmin,
    method: 'post',
    params: parameter
  })
}
